//
//  WaitingRepairViewController2.m
//  GetPowerDBO
//
//  Created by 周博 on 2017/8/5.
//  Copyright © 2017年 BogoZhou. All rights reserved.
//

#import "WaitingRepairViewController2.h"
#import "WaitingRepairChooseViewController.h"
#import "RepairByChooseDateViewController.h"
#import "WaitingRepairTableViewCell3.h"
#import "WaitingRepairTableViewCell4.h"
#import "WaitingRepairTableViewCell5.h"
#import "BorderHelper.h"
#import "SearchWaitingRepairViewController.h"
#import "CurveViewController.h"

#define kCellName3 @"WaitingRepairTableViewCell3"
#define kCellName4 @"WaitingRepairTableViewCell4"

#define kCell @"cell5"
#define kPageSize @"1000"


@interface WaitingRepairViewController2 ()<UITableViewDelegate,UITableViewDataSource,WaitingRepairChooseViewControllerDelegate,RepairByChooseDateViewControllerDelegate>
{
    NSInteger _offer;
    NSString *_chooseType;
    NSInteger _pageIndex;
    NSString *_chooseDate;
    CGFloat _cellWidth;
    NSString *_dateNew;
}
@property (nonatomic,strong) NSMutableArray *dataArray;
@property (nonatomic,strong) NSMutableArray *daiweihuArray;
@property (nonatomic,strong) NSMutableArray *weihuChenggongArray;
@property (nonatomic,strong) NSMutableArray *yiweihuArray;
@property (nonatomic,strong) UIView *rightView;
@property (nonatomic,strong) UILabel *rightLabel;
@end

@implementation WaitingRepairViewController2

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    [self UISetting];
    
    [self addGesture];

    [self scrollMove];
    
    [self loadData];

    
}

- (void)UISetting{
    _offer = 0;
    _cellWidth = (kScreenSize.width - 40)/5;
    _dataArray = [NSMutableArray array];
    _daiweihuArray = [NSMutableArray array];
    _weihuChenggongArray = [NSMutableArray array];
    _yiweihuArray = [NSMutableArray array];
    _dateNew = [BGDateHelper seeDay][0];
    _tableView.mj_header = [MJRefreshNormalHeader headerWithRefreshingBlock:^{
        _pageIndex = 0;
        [self loadData];
        [_tableView.mj_header endRefreshing];
    }];
    
    _tableView.mj_footer = [MJRefreshAutoFooter footerWithRefreshingBlock:^{
        _pageIndex ++;
        [self loadData];
        [_tableView.mj_footer endRefreshing];
    }];
    
    [_tableView registerClass:[WaitingRepairTableViewCell5 class] forCellReuseIdentifier:kCell];
    
    [self setButtonColor];
    
    [BorderHelper setViewWidthLineColor:ke6e6e6 view:_button1];

    _chooseDate = [BGDateHelper seeDay][0];
    _labelDate.text = [BGDateHelper seeDay][0];
    
//    [self setDateButtonColorByDate:[BGDateHelper seeDay][0]];
    
    UITapGestureRecognizer *tapRecognizerTel=[[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(chooseDateFunc)];
    
    _labelDate.userInteractionEnabled=YES;
    [_labelDate addGestureRecognizer:tapRecognizerTel];
}

- (void)creatRightViewWithStringContent:(NSString *)stringContent{
    
    if (!_rightView) {
        _rightView = [[UIView alloc] init];
    }
    
    if (!_rightLabel) {
        _rightLabel = [[UILabel alloc] init];
    }
    
    NSString *string ;
    if (stringContent.integerValue == 0) {//暂未统计
        string = @"暂未统计";
    }else{//维护成功达标率
        string = [NSString stringWithFormat:@"维护成功达标率:%.0lf%%",(double)(_weihuChenggongArray.count*100.00)/_daiweihuArray.count];
    }
    
    CGSize titleSize = [string boundingRectWithSize:CGSizeMake(kScreenSize.width, MAXFLOAT) options:NSStringDrawingUsesLineFragmentOrigin attributes:@{NSFontAttributeName:[UIFont systemFontOfSize:16]} context:nil].size;
    
    _rightLabel.frame = CGRectMake(20, 15, titleSize.width, 20);
    _rightLabel.text = string;
    _rightLabel.font = [UIFont systemFontOfSize:16];
    _rightLabel.textColor = kWhiteColor;
    
    _rightView.frame = CGRectMake(kScreenSize.width - _rightLabel.allWidth - 10, 250, _rightLabel.allWidth + 80, 50);
    _rightView.backgroundColor = [kGreenColor colorWithAlphaComponent:0.5];
    _rightView.layer.masksToBounds = YES;
    _rightView.layer.cornerRadius = 25;
    [self.view addSubview:_rightView];
    [_rightView addSubview:_rightLabel];
    
}


- (void)chooseDateFunc{
    UIStoryboard *storyboard = kMainStroyboard;
    RepairByChooseDateViewController *repairByChooseVC = [storyboard instantiateViewControllerWithIdentifier:@"RepairByChooseDateViewController"];
    repairByChooseVC.beginDate = @"2017-06-01";
    if (_chooseDate) {
        repairByChooseVC.start = _chooseDate;
        repairByChooseVC.end = _chooseDate;
    }else{
        repairByChooseVC.start = _dateNew;
        repairByChooseVC.end = _dateNew;
    }
    repairByChooseVC.delegate = self;
    [self presentViewController:repairByChooseVC animated:YES completion:nil];
}

- (void)setButtonColor{
    _button1.backgroundColor = kColorFrom0x(0xf0f0f0);
    _button1.tintColor = kColorFrom0x(0x595959);
    
    _button2.backgroundColor = kColorFrom0x(0xf0f0f0);
    _button2.tintColor = kColorFrom0x(0x595959);
    
    _button3.backgroundColor = kColorFrom0x(0xf0f0f0);
    _button3.tintColor = kColorFrom0x(0x595959);
    
    _chooseType = @"0";
}

- (void)setDateButtonColorByDate:(NSString *)date{

    //如果传入日期是今天，那么后一天数据不可选
    if ([date isEqualToString:_dateNew]) {
        if ([_dateNew isEqualToString:[BGDateHelper seeDayAroundToday:0][0]]) {
            _buttonYesterday.backgroundColor = kWhiteColor;
            _buttonYesterday.tintColor = kColorFrom0x(0x595959);
            
            _buttonTomorow.backgroundColor = kWhiteColor;
            _buttonTomorow.tintColor = kColorFrom0x(0xd2d2d2);
            
            _buttonTomorow.enabled = NO;
            _buttonYesterday.enabled = YES;
            _labelDate.text = [NSString stringWithFormat:@"%@(今日)",_labelDate.text];
        }else{
            _buttonYesterday.backgroundColor = kWhiteColor;
            _buttonYesterday.tintColor = kColorFrom0x(0x595959);
            
            _buttonTomorow.backgroundColor = kWhiteColor;
            _buttonTomorow.tintColor = kColorFrom0x(0xd2d2d2);
            
            _buttonTomorow.enabled = NO;
            _buttonYesterday.enabled = YES;
            _labelDate.text = [NSString stringWithFormat:@"%@(新)",_labelDate.text];
            
        }
        
    }
    //如果传入日期是6.1（分割日期），那么前一天数据不可选
    else if ([date isEqualToString:@"2018-06-01"]){
        _buttonYesterday.backgroundColor = kWhiteColor;
        _buttonYesterday.tintColor = kColorFrom0x(0xd2d2d2);
        
        _buttonTomorow.backgroundColor = kWhiteColor;
        _buttonTomorow.tintColor = kColorFrom0x(0x595959);
        
        _buttonTomorow.enabled = YES;
        _buttonYesterday.enabled = NO;
    }
    //如果传入日期是中间日期 ，则都可以选择
    else{

        if ([date isEqualToString:[BGDateHelper seeDayAroundToday:1][0]]) {//如果 是明天
            _buttonYesterday.backgroundColor = kWhiteColor;
            _buttonYesterday.tintColor = kColorFrom0x(0x595959);
            
            _buttonTomorow.backgroundColor = kWhiteColor;
            _buttonTomorow.tintColor = kColorFrom0x(0x595959);
            
            _buttonTomorow.enabled = YES;
            _buttonYesterday.enabled = YES;
            _labelDate.text = [NSString stringWithFormat:@"%@",_labelDate.text];
        }else if ([date isEqualToString:[BGDateHelper seeDayAroundToday:0][0]]) {//如果 是明天
            _buttonYesterday.backgroundColor = kWhiteColor;
            _buttonYesterday.tintColor = kColorFrom0x(0x595959);
            
            _buttonTomorow.backgroundColor = kWhiteColor;
            _buttonTomorow.tintColor = kColorFrom0x(0x595959);
            
            _buttonTomorow.enabled = YES;
            _buttonYesterday.enabled = YES;
            _labelDate.text = [NSString stringWithFormat:@"%@(今日)",_labelDate.text];
        }else{
            _buttonYesterday.backgroundColor = kWhiteColor;
            _buttonYesterday.tintColor = kColorFrom0x(0x595959);
            
            _buttonTomorow.backgroundColor = kWhiteColor;
            _buttonTomorow.tintColor = kColorFrom0x(0x595959);
            _buttonTomorow.enabled = YES;
            _buttonYesterday.enabled = YES;
        }
    }
    
    //如果传入日期是今天，那么左右显示，昨天和明天
    if ([date isEqualToString:[BGDateHelper seeDayAroundToday:0][0]]) {
        if ([_dateNew isEqualToString:[BGDateHelper seeDayAroundToday:0][0]]) {
            [_buttonYesterday setTitle:@"昨天" forState:UIControlStateNormal];
            [_buttonTomorow setTitle:@"明天" forState:UIControlStateNormal];
        }else{
            [_buttonYesterday setTitle:@"昨天" forState:UIControlStateNormal];
            [_buttonTomorow setTitle:@"明天(新)" forState:UIControlStateNormal];
        }
    }
    //如果传入日期是明天，那么左右显示，今天和后一天
    else if ([date isEqualToString:[BGDateHelper seeDayAroundToday:1][0]]){
        [_buttonYesterday setTitle:@"今天" forState:UIControlStateNormal];
        [_buttonTomorow setTitle:@"后一天" forState:UIControlStateNormal];
    }
    //如果传入日期是昨天，那么左右显示，前一天和今天
    else if ([date isEqualToString:[BGDateHelper seeDayAroundToday:-1][0]]){

        [_buttonYesterday setTitle:@"前一天" forState:UIControlStateNormal];
        [_buttonTomorow setTitle:@"今天" forState:UIControlStateNormal];
    }
    //传入日期是中间时间， 则显示 前一天  后一天
    else{

        [_buttonYesterday setTitle:@"前一天" forState:UIControlStateNormal];
        [_buttonTomorow setTitle:@"后一天" forState:UIControlStateNormal];
    }
    

    
    NSLog(@"date -> %@",date);
    NSLog(@"newDate -> %@",_dateNew);

}

- (void)twoButtonCountButton1:(NSInteger)button1 button2:(NSInteger)button2 button3:(NSInteger)button3{
    [_button1 setTitle:[NSString stringWithFormat:@"待维护 (%ld)",button1] forState:UIControlStateNormal];
    [_button2 setTitle:[NSString stringWithFormat:@"维护成功 (%ld)",button2] forState:UIControlStateNormal];
    [_button3 setTitle:[NSString stringWithFormat:@"已维护 (%ld)",button3] forState:UIControlStateNormal];
}

#pragma mark - 网络请求
- (void)loadData{
    
    [self.hub hideAnimated:YES];
    self.hub = [MBProgressHUD showHUDAddedTo:self.view animated:YES];
    
    // Set the label text.
    self.hub.label.text = NSLocalizedString(@"加载中...", @"HUD loading title");
    
    NSString *pageIndexString = [NSString stringWithFormat:@"%ld",_pageIndex];
    [[AFClient shareInstance] waitingRepairByEid:kUserId page_size:kPageSize page_index:pageIndexString date:_chooseDate status:nil progressBlock:nil success:^(id responseBody) {
        [self.hub hideAnimated:YES];
        if ([responseBody[@"code"] integerValue] == 200) {
            _dateNew = responseBody[@"new_date"];
            if (_pageIndex == 0) {
                [_dataArray removeAllObjects];
                [_daiweihuArray removeAllObjects];
                [_weihuChenggongArray removeAllObjects];
                [_yiweihuArray removeAllObjects];
            }
            for (NSDictionary *dic in responseBody[@"data"]) {
                WaitingRepairModel *model = [[WaitingRepairModel alloc] init];
                [model setValuesForKeysWithDictionary:dic];
                model.store_info = dic[@"store_info"];
                
                [_dataArray addObject:model];
                if (model.status.integerValue == 0) {//待维护
                    [_daiweihuArray addObject:model];
                }else{
                    [_weihuChenggongArray addObject:model];
                }
                
                if (model.maintained_status.integerValue == 1) {
                    [_yiweihuArray addObject:model];
                }
            }
            [self twoButtonCountButton1:_daiweihuArray.count button2:_weihuChenggongArray.count button3:_yiweihuArray.count];
            [self creatRightViewWithStringContent:responseBody[@"is_calculation"]];

            
            NSDateFormatter *format = [[NSDateFormatter alloc] init];
            // 设置日期格式 为了转换成功
            format.dateFormat = @"yyyy-MM-dd";
            NSDate *date = [format dateFromString:_chooseDate];
            
            [_tableView reloadData];

            if ([_chooseDate isEqualToString:_dateNew] && _offer > 0) {
                return;
            }
            
            if ([_chooseDate isEqualToString:@"2017-06-01"] && _offer < 0) {
                return;
            }
            _chooseDate = [BGDateHelper seeDayAroundTheDay:date dayNum:0][0];
            
            _labelDate.text = [BGDateHelper seeDayAroundTheDay:date dayNum:0][8];
            
            [self setDateButtonColorByDate:[BGDateHelper seeDayAroundTheDay:date dayNum:0][0]];
            
            [self setButtonColor];
            
            
            [_tableView reloadData];
        }else{
            kAlert(responseBody[@"message"]);
        }
    } failure:^(NSError *error) {
        [self.hub hideAnimated:YES];
    }];
}

#pragma mark - 点击事件

- (IBAction)backButtonClick:(UIButton *)sender {
    [self.navigationController popViewControllerAnimated:YES];
}

//101 -> 待维护 ; 102 -> 今日维护成功
- (IBAction)twoButtonClick:(UIButton *)sender {
    if (sender.tag == 101) {//待维护
        _button1.backgroundColor = kColorFrom0x(0x88e691);
        _button1.tintColor = kWhiteColor;
        
        _button2.backgroundColor = kColorFrom0x(0xf0f0f0);
        _button2.tintColor = kColorFrom0x(0x595959);
        
        _button3.backgroundColor = kColorFrom0x(0xf0f0f0);
        _button3.tintColor = kColorFrom0x(0x595959);
        _chooseType = @"1";
    }else if(sender.tag == 102){//今日维护成功
        _button2.backgroundColor = kColorFrom0x(0x88e691);
        _button2.tintColor = kWhiteColor;
        
        _button1.backgroundColor = kColorFrom0x(0xf0f0f0);
        _button1.tintColor = kColorFrom0x(0x595959);
        
        _button3.backgroundColor = kColorFrom0x(0xf0f0f0);
        _button3.tintColor = kColorFrom0x(0x595959);
        _chooseType = @"2";
    }else{
        _button3.backgroundColor = kColorFrom0x(0x88e691);
        _button3.tintColor = kWhiteColor;
        
        _button1.backgroundColor = kColorFrom0x(0xf0f0f0);
        _button1.tintColor = kColorFrom0x(0x595959);
        
        _button2.backgroundColor = kColorFrom0x(0xf0f0f0);
        _button2.tintColor = kColorFrom0x(0x595959);
        _chooseType = @"3";
    }
    
    _pageIndex = 0;
    
//    [self loadData];
    [_tableView reloadData];
}

//201前一天； 202后一天
- (IBAction)daysButtonClick:(UIButton *)sender {
    if (sender.tag == 201) {
        _offer = -1;
    }else{
        _offer = 1;
    }
    [self scrollMove];
}

//点击搜索
- (IBAction)searchButtonClick:(UIButton *)sender {
    [self.hub hideAnimated:YES];
    self.hub = [MBProgressHUD showHUDAddedTo:self.view animated:YES];
    
    // Set the label text.
    self.hub.label.text = NSLocalizedString(@"加载中...", @"HUD loading title");
    
    UIStoryboard *storyboard = kMainStroyboard;
    SearchWaitingRepairViewController *searchVC = [storyboard instantiateViewControllerWithIdentifier:@"SearchWaitingRepairViewController"];
    searchVC.dataArray = _dataArray;
//    [self.navigationController pushViewController:searchVC animated:YES];

    [self presentViewController:searchVC animated:YES completion:^{
        [self.hub hideAnimated:YES];
    }];
}

//点击问号
- (IBAction)wenhaoButtonClick:(UIButton *)sender {
    NSString *message = @"1、WiFi设备\n每台设备不足在线120分钟\n2、密码设备\n店铺内密码设备，使用率低于80%\n3、判定维护成功\n在以上2点基础上，全部WiFi设备必须被APP【扫码充电】功能使用过";
    UIAlertController *alert = [UIAlertController alertControllerWithTitle:nil message:message preferredStyle:UIAlertControllerStyleAlert];
    
    NSMutableParagraphStyle *paragraphStyle = [[NSMutableParagraphStyle alloc] init];
    //paragraphStyle.lineBreakMode = NSLineBreakByWordWrapping;
    paragraphStyle.alignment = NSTextAlignmentLeft;
    //行间距
    paragraphStyle.lineSpacing = 5.0;
    NSDictionary * attributes = @{NSFontAttributeName : [UIFont systemFontOfSize:14.0], NSParagraphStyleAttributeName : paragraphStyle};
    NSMutableAttributedString *attributedTitle = [[NSMutableAttributedString alloc] initWithString:message];
    [attributedTitle addAttributes:attributes range:NSMakeRange(0, message.length)];
    // 下面这句话用了KVC ，将attributes的值给了alert
    [alert setValue:attributedTitle forKey:@"attributedMessage"];//attributedTitle\attributedMessage
    //end ---
    
    UIAlertAction *action = [UIAlertAction actionWithTitle:@"确定" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
    }];
    
    [alert addAction:action];
    [self presentViewController:alert animated:YES completion:nil];
}



- (void)scrollMove{
    NSDateFormatter *format = [[NSDateFormatter alloc] init];
    // 设置日期格式 为了转换成功
    format.dateFormat = @"yyyy-MM-dd";
    NSDate *date = [format dateFromString:_chooseDate];

    
    if ([_chooseDate isEqualToString:_dateNew] && _offer > 0) {
        return;
    }
    
    if ([_chooseDate isEqualToString:@"2017-06-01"] && _offer < 0) {
        return;
    }
    _chooseDate = [BGDateHelper seeDayAroundTheDay:date dayNum:_offer][0];

    _labelDate.text = [BGDateHelper seeDayAroundTheDay:date dayNum:_offer][8];

    [self setDateButtonColorByDate:[BGDateHelper seeDayAroundTheDay:date dayNum:_offer][0]];

    [self setButtonColor];
    _pageIndex = 0;
    [self loadData];

}

- (void)addGesture{
    _offer = 0;
    UISwipeGestureRecognizer *toRightRecognizer = [[UISwipeGestureRecognizer alloc]initWithTarget:self action:@selector(handleSwipeFrom:)];
    [toRightRecognizer setDirection:(UISwipeGestureRecognizerDirectionRight)];
    [self.view addGestureRecognizer:toRightRecognizer];
    
    UISwipeGestureRecognizer *toLeftRecognizer = [[UISwipeGestureRecognizer alloc]initWithTarget:self action:@selector(handleSwipeFrom:)];
    [toLeftRecognizer setDirection:(UISwipeGestureRecognizerDirectionLeft)];
    [self.view addGestureRecognizer:toLeftRecognizer];
}

- (void)handleSwipeFrom:(UISwipeGestureRecognizer *)recognizer{
    if(recognizer.direction == UISwipeGestureRecognizerDirectionDown) {
        NSLog(@"swipe down");
    }
    if(recognizer.direction == UISwipeGestureRecognizerDirectionUp) {
        NSLog(@"swipe up");
    }
    if(recognizer.direction == UISwipeGestureRecognizerDirectionLeft) {
        NSLog(@"swipe left");
        _offer = 1;
    }
    if(recognizer.direction == UISwipeGestureRecognizerDirectionRight) {
        NSLog(@"swipe right");
        _offer = -1;
    }
    
    

    [self scrollMove];

}

#pragma mark - RepairByChooseDateViewControllerDelegate

- (void)getChooseDate:(NSString *)dateString{
    _chooseDate = dateString;
    _labelDate.text = [BGDateHelper getTimeArrayByTimeString:[BGDateHelper getTimeStempByString:dateString havehh:NO]][9];
    _pageIndex = 0;

    
    NSDateFormatter *format = [[NSDateFormatter alloc] init];
    // 设置日期格式 为了转换成功
    format.dateFormat = @"yyyy-MM-dd";
    NSDate *date = [format dateFromString:_chooseDate];
    
    [self setDateButtonColorByDate:[BGDateHelper seeDayAroundTheDay:date dayNum:0][0]];

    
    [self setButtonColor];
    [self loadData];
}

#pragma mark - WaitingRepairChooseViewControllerDelegate

- (void)getChooseItem:(NSString *)type{
    _chooseType = type;
    NSLog(@"chooseType -> %@",type);
    _pageIndex = 0;
    [self loadData];
}

#pragma mark - tableViewDelegate

- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView{
    return 1;
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
    if (_chooseType.integerValue == 1) {//待维护
        [self creatImageBackView:_daiweihuArray];
        return _daiweihuArray.count;
    }else if (_chooseType.integerValue == 2){//维护成功
        [self creatImageBackView:_weihuChenggongArray];
        return _weihuChenggongArray.count;
    }else if (_chooseType.integerValue == 3){//已维护
        [self creatImageBackView:_yiweihuArray];
        return _yiweihuArray.count;
    }else{
        [self creatImageBackView:_dataArray];
        return _dataArray.count;
    }
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
    WaitingRepairModel *model ;
    if (_chooseType.integerValue == 1) {//待维护
        model = _daiweihuArray[indexPath.row]; ;
    }else if (_chooseType.integerValue == 2){//维护成功
        model = _weihuChenggongArray[indexPath.row]; ;
    }else if (_chooseType.integerValue == 3){
        model = _yiweihuArray[indexPath.row]; ;
    }else{
        model = _dataArray[indexPath.row];
    }

    WaitingRepairTableViewCell5 *cell = (WaitingRepairTableViewCell5 *)[tableView dequeueReusableCellWithIdentifier:kCell];
    
    if (!cell) {
        cell = [[WaitingRepairTableViewCell5 alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:kCell];
    }
    
    cell.selectionStyle = UITableViewCellSelectionStyleNone;

    
    if ([model.date isEqualToString:[BGDateHelper seeDay][0]]) {
        [cell showDataWithModel:model andType:@"1"];

        return cell;
    }else{

        [cell showDataWithModel:model andType:@"2"];
        return cell;
    }
    
}

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
    UIStoryboard *storyboard = kMainStroyboard;
    CurveViewController *curveVC = [storyboard instantiateViewControllerWithIdentifier:@"CurveViewController"];
    WaitingRepairModel *model = _dataArray[indexPath.row];
    model.shop = [[ShopModel alloc] init];
    [model.shop setValuesForKeysWithDictionary:model.store_info];
    curveVC.shopId = model.shop.id;
    curveVC.shopName = model.shop.name;
    curveVC.typString = @"0";
    curveVC.beginDate = [BGDateHelper getTimeArrayByTimeString:[BGDateHelper getTimeStempByString:model.shop.created havehh:YES]][0];
    [self.navigationController pushViewController:curveVC animated:YES];
}

- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{

    WaitingRepairTableViewCell5 *cell = (WaitingRepairTableViewCell5 *)[self tableView:tableView cellForRowAtIndexPath:indexPath];
//    NSLog(@"cellHeight -> %lf",[cell height]);
    return [cell height];
    
}


- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
